import request from "@/libs/request";

const basePath = '/appcloud-data' ;

export const apiUrls = {
	deleteGroup : basePath + '/api/dict/delete/',
	getAcDictByGroupNames : basePath + '/api/dict/getAcDictByGroupNames/',
	getAcDictByType : basePath + '/api/dict/getAcDictByType/',
	getAcDictByTypeName : basePath + '/api/dict/getAcDictByTypeName/',
	getAllAcDict : basePath + '/api/template/getAppTypes/',
	save : basePath + '/api/dict/save/',
	update : basePath + '/api/dict/update/',
}


// 删除字典
export async function deleteGroup(params){
	return request( apiUrls.deleteGroup + `${params.id}` , {
      method:'GET'
  })
}

// 根据字典 groupName 列表 获取所有字典信息
export async function getAcDictByGroupNames(params){
	return request( apiUrls.getAcDictByGroupNames , {
      method:'POST',
      body:params
  })
}

// 根据类型获取字典信息
export async function getAcDictByType(params){
	return request( apiUrls.getAcDictByType + `${params.type}` , {
      method:'GET'
  })
}


// 根据类型名称获取字典信息
export async function getAcDictByTypeName(params){
	return request( apiUrls.getAcDictByTypeName + `${params.typeName}` , {
      method:'GET',
      //body:params
  })
}


// 根据类型获取字典信息 0应用  1组件
export async function getAllAcDict(type){
	return request( apiUrls.getAllAcDict + type , {
      method:'GET',
      //body:params
  })
}


// 保存字典
export async function save(params){
	return request( apiUrls.save , {
      method:'POST',
      body:params
  })
}

// 更新字典
export async function update(params){
	return request( apiUrls.update , {
      method:'POST',
      body:params
  })
}





